﻿using MrPP.UX;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace MrPP.SerriedCabinet
{
    [System.Serializable]
    public struct BoxLocation
    {
        public int box;
        public int layer;
        public int sile;
        public Box.Type type;

     

        public static bool operator == (BoxLocation lhs, BoxLocation rhs)
        {
           
            return lhs.Equals(rhs);
        }

        public static bool operator !=(BoxLocation lhs, BoxLocation rhs)
        {

            return !lhs.Equals(rhs);
        }
        public override string ToString()
        {
            return "第" + (box+1) + "列," +(layer+1) + "层,"+ (type==Box.Type.Left?"左侧":"右侧") + (sile+1) + "节";
        }

        public string typeToString()
        {
            return (type == Box.Type.Left ? "左侧" : "右侧");
        }

        public string boxToString()
        {
            return (box + 1).ToString();
        }

        public string layerToString()
        {
            return (layer + 1).ToString();
        }

        public string sileToString()
        {
            return (sile + 1).ToString();
        }

        public override bool Equals(object obj)
        {
            return obj is BoxLocation location &&
                   box == location.box &&
                   layer == location.layer &&
                   sile == location.sile &&
                   type == location.type;
        }

        public override int GetHashCode()
        {
            var hashCode = -639845221;
            hashCode = hashCode * -1521134295 + box.GetHashCode();
            hashCode = hashCode * -1521134295 + layer.GetHashCode();
            hashCode = hashCode * -1521134295 + sile.GetHashCode();
            hashCode = hashCode * -1521134295 + type.GetHashCode();
            return hashCode;
        }
    }
    public struct ShelveData
    {
        public string sn;
        public BoxLocation location;

    }
    public interface IShelveModel
    {

        void doPlay();
        void doReset();
        void doStop();
        void doLast();
        void doNext();
        void doBinding(int id);
        void doSelected(BoxLocation location);

        void doScanning(string sn);

    }
}